home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-10-09 | 1.1 KB | 38 lines | [TEXT/MEDT] |
- MODULE CursorExample; (* module shows you how to define an own cursor *)
-
- FROM CursorMouse IMPORT Pattern, SetPattern, ResetPattern,
- GetMouse, ML, MM, MR;
-
- VAR OwnCursor : Pattern;
- Buttons :BITSET;
- i : CARDINAL;
- x,y : INTEGER;
-
- BEGIN
- (* Define own cursor (a diagonal cross on white ground) *)
- FOR i:=0 TO 15 DO
- OwnCursor.raster[i]:={};
- INCL(OwnCursor.raster[i],i);
- INCL(OwnCursor.raster[i],15-i);
- OwnCursor.mask[i]:={0..15};
- END (* FOR *);
- OwnCursor.hotSpv := 8;
- OwnCursor.hotSph := 8;
- SetPattern(OwnCursor);
- LOOP
- GetMouse(Buttons,x,y);
- IF (MM IN Buttons) & (ML IN Buttons) THEN
- (* Command key and mouse button pressed: leave the program *)
- EXIT
- ELSIF (MR IN Buttons) & (ML IN Buttons) THEN
- (* Option key and mouse button pressed: reactivate own cursor *)
- SetPattern(OwnCursor);
- ELSIF (ML IN Buttons) THEN
- (* Only mouse button pressed: reactivate standard arrow cursor *)
- ResetPattern;
- END (* IF *);
- END (* LOOP *);
- ResetPattern;
- END CursorExample.
-
-